<div id="pan">
	<?php echo $html->link(__('Home',true), '/'); ?> &gt; 
	<strong><?php echo __('Article',true); ?></strong>
	<ul class="navi">
		<li class="navi_left"><?php echo $paginator->prev(__('<< prev ', true), null, null, array('class'=>'disabled'));?></li>
		<li class="navi_right"><?php echo $paginator->next(__(' next >>', true), null, null,  array('class'=>'disabled'));?></li>
		<li><?php echo $paginator->numbers();?></li>
	</ul>
</div>

<h2><?php __('Articles');?></h2>
<div class="post">
<p><?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>

<table cellpadding="0" cellspacing="1">
<tr>
	<th><?php echo $paginator->sort('id');?></th>
	<th><?php echo $paginator->sort('title');?></th>
	<th><?php echo $paginator->sort('user_id');?></th>
	<th><?php echo $paginator->sort('rank_id');?></th>
	<th><?php echo $paginator->sort('created');?></th>
	<th><?php echo __('Action');?></th>
</tr>
<?php
$i = 0;
foreach ($articles as $article):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td><?php echo $article['Article']['id']; ?></td>
		<td><?php echo $html->link($article['Article']['title'], array('action'=>'view', $article['Article']['id'])); ?></td>
		<td><?php echo $html->link($article['User']['username'], array('action'=>'index',$article['User']['id'],'user')); ?></td>
		<td><?php echo $html->link($article['Rank']['name'], array('action'=>'index',$article['Rank']['id'],'rank')); ?></td>
		<td><?php echo $article['Article']['created']; ?></td>
		<td>
		<button class="icon LoreleiIconPlayMidi" value="<?php echo $article['Article']['id']; ?>" />
		<?php if (isset($auth) && $article['User']['id'] == $auth['User']['id']){ ?>&nbsp;<button class="icon LoreleiIconEdit" value="<?php echo $article['Article']['id']; ?>" /><?php }?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>

<div id="media"></div>

<?php
$this->addScript($javascript->codeBlock('
dojo.require("dojo.parser");	// scan page for widgets and instantiate them
dojo.require("dijit.form.Button");
dojo.require("lorelei.articles");

dojo.addOnLoad(function (){
	lorelei.articles.index();
});
',array('inline' => false)));
?>